<script type="text/javascript">
$(function(){
//	$.get("inventorymanagement/getFilesInfo",getResponseFilesInfo,"json");
	$.get("applicationSingle/getCardInfo",function(data){
		var contentb="<option value='' selected>请选择</option>";
		var i;
		$(data).each(function(n,item){
			for(i=0;i<item.cdProDefinitions.length;i++){
				
				contentb+="<option value="+item.cdProDefinitions[i].cardpCode+">"
				+item.cdProDefinitions[i].cardpName+"</option>"
			}
			$("#cardPNameByQueryIncomingAndOutgoing").html(contentb);
		});
	},"json");
	$.post("inventorymanagement/getUserAndBanch",function(json){
		var activeUser = json.activeUser;
		var userNo=activeUser.userNo;
		var branchNo=activeUser.branchNo;
		var branchName = activeUser.branchName;
		$("input[name='empNoByQureryInventory']").val(userNo);
		$("input[name='branchNoByQueryInventory']").val(branchNo);
		if(branchNo!="10000000"){
			var contentb="";
			contentb+="<option value="+activeUser.branchName+">"
			+activeUser.branchName+"</option>"
			$("select[name='branchNameByQueryIncomingAndOutgoing']").html(contentb);
		}
		if(branchNo=="10000000"){
		$.post("tellerManage/getpaperAndBranch",function(json){
				 var contentb="<option value=''>请选择</option>";
				 $(json).each(function(n,item){
					for(i=0;i<item.branchs.length;i++){
							contentb+="<option value="+item.branchs[i].orgName+">"
							+item.branchs[i].orgName+"</option>"					
					};
					$("select[name='branchNameByQueryIncomingAndOutgoing']").html(contentb);
			});
		 },"json");
		}
		/* var curDate = new Date();
		var curYear = curDate.getFullYear();
		var lastYear = parseInt(curYear)-1;
		var nextYear = parseInt(curYear)+1;
		var contentHtml = "<option value='"+curYear+nextYear+"'>"+curYear+"~"+nextYear+"年度</option>";
		$("#dateByIncomingAndOutgoing").html(contentHtml);
				
		var dateByIncomingAndOutgoing = $("#dateByIncomingAndOutgoing").val();
		console.log("dateByIncomingAndOutgoing==>"+dateByIncomingAndOutgoing); */
		var dateYMFromByIncomingAndOutgoing = "";
		var dateYMToByIncomingAndOutgoing = "";
		var param = {"dateYMFromByIncomingAndOutgoing":dateYMFromByIncomingAndOutgoing,"dateYMToByIncomingAndOutgoing":dateYMToByIncomingAndOutgoing,
				"branchNoByLoad":branchNo,"branchNameByQueryIncomingAndOutgoing":branchName};
		$.post("inventoryQueryOfIncomingAndOutgoing/getIncomingAndOutgoingInfo",param,getIncomingAndOutgoingInfo,"json");
	},"json");
	
	//20190226 hgl 增加以下12行
	$("#queryIncomingAndOutgoing").click(function(){
		var dateYMFrom = $("input[name='dateYMFromByIncomingAndOutgoing']").val();
		var dateYMTo = $("input[name='dateYMToByIncomingAndOutgoing']").val();
		if(dateYMFrom && dateYMTo){
			var dateYMFromN = parseInt(dateYMFrom.replace("-",""));
			var dateYMToN = parseInt(dateYMTo.replace("-",""));
			if(dateYMFromN>dateYMToN){
				alertMsg.warn("日期（起）不能大于日期（止）！");
				return false;
			}
		}
	});

});

</script>	
<div class="pageHeader ">
	<form id="pagerForm" method="post" action="inventoryQueryOfIncomingAndOutgoing/getIncomingAndOutgoingInfo" class="pageForm required-validate" onsubmit="return validateCallback(this,getIncomingAndOutgoingInfo);">
		<input type="hidden" name="pageNum" value="" /> 
		<input type="hidden" name="numPerPage" value="" />
		<input name="empNoByInventory" type="hidden" value="">
		<input name="branchNoByInventory" type="hidden" value="">
		<div class="searchBar">	
			<table class="searchContent">
			<tr>
				<td><label>网点名称：</label></td>
				<td style="text-align:left;"><select id="branchNameByQueryIncomingAndOutgoing" name="branchNameByQueryIncomingAndOutgoing" ></select></td>
			</tr>
            <tr>
            	<td><label>卡产品名称：</label></td>
				<td style="text-align:left;"><select id="cardPNameByQueryIncomingAndOutgoing" name="cardPNameByQueryIncomingAndOutgoing" ></select></td>		
			</tr> 
			<tr>
            	<td><label>日期（起）：</label></td>
				<td style="text-align:left;">
					<input class="dateYM" id="dateYMFromByIncomingAndOutgoing" name="dateYMFromByIncomingAndOutgoing" >
				</td>		
			</tr>
			<tr>
				<td><label>日期（止）：</label></td>
				<td style="text-align:left;">
					<input class="dateYM" id="dateYMToByIncomingAndOutgoing" name="dateYMToByIncomingAndOutgoing" >
				</td>
			</tr>	
			<!-- <tr>
            	<td><label>日期（年份）止：</label></td>
				<td style="text-align:left;">
					<select id="dateByIncomingAndOutgoing" name="dateByIncomingAndOutgoing" >
					</select>
				</td>
				<td><label>日期（月份）止：</label></td>
				<td style="text-align:left;">
					<select id="dateByIncomingAndOutgoing" name="dateByIncomingAndOutgoing" >
					</select>
				</td>			
			</tr> -->
			
			<!-- <tr>
            	<td><label>日期：</label></td>
				<td style="text-align:left;">
					<select id="dateByIncomingAndOutgoing" name="dateByIncomingAndOutgoing" >
					</select>
				</td>		
			</tr>  -->
			</table>
		<div class="subBar">
			<ul> 
				<li>
				<div class="buttonActive" ><div class="buttonContent" ><button id="queryIncomingAndOutgoing" type="submit">查询</button></div></div>
				</li>
			</ul>
		</div>
		</div>
	</form>	
</div>
<div class="pageContent" >
<form method="post" action="" class="pageForm required-validate" onsubmit="return validateCallback(this,printViewPageAjaxDone);" >
<div class="panelBar">
	<ul class="toolBar">
		<li><a id="printTable" class="add" onclick="printTableInfo(this);" url="queryIncomeInfo" name="出入库查询"><span>打印预览</span></a></li>
	</ul>
</div>
<div id="queryIncomeInfo">
		<table class="table" width="800">
			<thead>
				<tr>
					<th width="2%" align="center">序号</th>
					<th width="10%" align="center">网点名称</th>
					<th width="5%" align="center">网点编号</th>
					<th width="8%" align="center">卡产品</th>
					<th width="5%" align="center">卡类型</th>
					<th width="5%" align="center">日期</th>       
					<th width="5%" align="center">购卡数量</th>     
					<th width="5%" align="center">发卡数量</th>       
				</tr>
			</thead>
			<tbody id="queryIncomeTable">
			</tbody>
		</table>
</div>
</form>
</div>

	



